<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>BB量化交易系统-登录</title>
	<link rel="icon" href="/static/images/bb-32.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="/static/images/bb-32.ico" type="image/x-icon"/>
	
	<link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/icon.css">
	<!-- <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/demo/demo.css"> -->
	<script type="text/javascript" src="/static/plugins/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="/static/plugins/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/static/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body style="background:url(/static/images/bg3.jpg);background-size:cover">
    <div class="easyui-window" title="登录" data-options="modal:true,collapsible:false,shadow:true,closed:false,iconCls:'Lockgo',closable:false,minimizable:false" style="width:500px;padding:20px 70px 20px 70px;background:url(/static/images/bg.jpg)center;background-size:cover">
    	<div >
    		<h1 style="text-align:center;color:#fff">登    录</h1>
    	</div>
        <div style="margin:40px 0 40px 0">
            <input class="easyui-textbox" id="email" name="email" type="text" maxlength="32" style="width:100%;height:30px;padding:12px" data-options="prompt:'邮箱',iconCls:'icon-man',iconWidth:38">
        </div>
        <div style="margin:40px 0 40px 0">
            <input class="easyui-textbox" id="password" name="password" type="password" maxlength="32" style="width:100%;height:30px;padding:12px" data-options="prompt:'登录密码',iconCls:'icon-lock',iconWidth:38">
        </div>
        <div style="margin:40px 0 40px 0">
            <a href="javascript:;" onclick="dologin()" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="padding:5px 0px;width:100%;">
                <span style="font-size:14px;">登录</span>
            </a>
        </div>
        <div  style="margin:40px 0 40px 0;">
            <!-- <a href="./register" style="color:#fff">没有账号，去注册</a> -->
        </div>
</div>

</body>
<script type="text/javascript">
function dologin(){
	var email = $("input[name='email']").val().trim();
	var password = $("input[name='password']").val().trim();
	var patt = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/g;
	var boo = patt.test(email)
	if(!boo){
		$.messager.alert('错误','请输入一个正确的邮箱','error');
		return;
	}
	if(!password){
		$.messager.alert('错误','密码不能为空','error');
		return;
	}
	$.messager.progress({title:'请稍候',msg:'正在登录...'});
	$.post("./user/login",{"email":email,"password":password},function(res){
		$.messager.progress('close');
		if(res.status == 200){
			window.location.href="/index";
		}else{
			$.messager.alert('提示',res.message,'info');
		}
	})
	
}
</script>
</html>